package com.zone.component_home.viewtype

import com.zone.component_home.R
import com.zone.component_home.model.MultipleLayout
import com.zone.core.base.BaseBindingAdapter

class ItemViewType :
    BaseBindingAdapter.ItemViewTypeCreator {
    override fun getItemViewType(position: Int, item: Any?): Int {
        if (item is MultipleLayout) {
            return item.viewType
        }
        return 0
    }

    override fun getItemLayout(viewType: Int): Int {
        return when (viewType) {
            1 -> {
                R.layout.item_square_template_1
            }

            2 -> {
                R.layout.item_square_template_2
            }

            else -> {
                R.layout.item_default
            }
        }

    }
}